Trait isotope::ctx::cons::ConsCtx[][src]

pub trait ConsCtx {
    fn is_pointer_cons(&self) -> bool;
fn shallow_cons(&mut self, id: &TermId) -> Option<TermId>;
fn try_cons(&self, id: &Term) -> Result<Option<TermId>, ()>;
fn check_cons(&self, id: &Term) -> bool;
fn uncons(&self, code: Code) -> Option<TermId>;
fn as_dyn_cons_mut(&mut self) -> &mut dyn ConsCtx; }
Expand description

A type which may be used as a context for creating isotope terms

Required methods

Whether when two terms are consed by this context they are guaranteed to be pointer-equal

Shallow-cons a term; if already consed, return TermId.

Note that if a deep-cons property is desired, this function should only ever be called with deep-consed terms!

Try to cons a Term.

Check whether this TermId is consed

Get a term with the given code, if any has been registered into this context. May not be the only term with that code in the case of a hash collision.

Convert this to a trait pointer

Note: due to trait issues, there can be no default implementation for this

Implementations on Foreign Types

Implementors